package org.finesys.ai.core.balance;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Objects;

/**
 * 查询余额响应接口
 */
public class BalanceResponse {
    @JsonProperty
    private Boolean is_available;
    @JsonProperty
    private List<BalanceInfos> balance_infos;

    public BalanceResponse(Builder builder) {
        this.is_available = builder.is_available;
        this.balance_infos = builder.balance_infos;
    }

    public Boolean getIs_available() {
        return is_available;
    }

    public List<BalanceInfos> getBalance_infos() {
        return balance_infos;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BalanceResponse that = (BalanceResponse) o;
        return Objects.equals(is_available, that.is_available) && Objects.equals(balance_infos, that.balance_infos);
    }

    @Override
    public int hashCode() {
        return Objects.hash(is_available, balance_infos);
    }

    @Override
    public String toString() {
        return "BalanceResponse{" +
                "is_available=" + is_available +
                ", balance_infos=" + balance_infos +
                '}';
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Boolean is_available;
        private List<BalanceInfos> balance_infos;

        private Builder() {
        }

        public Builder setIs_available(Boolean is_available) {
            this.is_available = is_available;
            return this;
        }

        public Builder setBalance_infos(List<BalanceInfos> balance_infos) {
            this.balance_infos = balance_infos;
            return this;
        }

        public BalanceResponse build() {
            return new BalanceResponse(this);
        }
    }
}
